package com.camundademo.listener;

import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.springframework.stereotype.Component;

public class ProcessListener {

    @Component("ProcessListener.PubStartListener")
    public static class PubStartListener implements JavaDelegate {
        @Override
        public void execute(DelegateExecution execution) throws Exception {
            System.out.println(
                    ">>>>ProcessListener.PubStartListener>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<" + execution.getEventName());
        }
    }

    @Component("ProcessListener.PubEndListener")
    public static class PubEndListener implements JavaDelegate {
        @Override
        public void execute(DelegateExecution execution) throws Exception {
            System.out.println(
                    ">>>>ProcessListener.PubEndListener>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<" + execution.getEventName());
        }
    }

}
